import Vue from 'vue'
import Vuex from 'vuex'
import Cookie from 'js-cookie'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
	  // token:Cookie.get('token')==undefined?'':Cookie.get('token'),
	  token:localStorage.getItem('token')===undefined?'':localStorage.getItem('token'),
	  // userinfo:'登陆注册',
	  loginshow:true,
	  // u_id:Cookie.get('u_id')===undefined?'':Cookie.get('u_id'),
	  u_id:localStorage.getItem('u_id')===undefined?'':localStorage.getItem('u_id'),
	  // message:Cookie.get('message')===undefined?'登陆注册':Cookie.get('message')
	  message:localStorage.getItem('message')==undefined?'登陆注册':localStorage.getItem('message'),
  },
  mutations: {
	  setToken(xx,token){
		  xx.token=token
	  },
	  setTel(xx,u_id){
	  		  xx.u_id=u_id
	  },
	  setMessage(xx,message){
		  xx.message = message
	  }
  },
  actions: {
  },
  modules: {
  }
})
